package gamesys.games.particlesystem.core
{
	import gamesys.games.particlesystem.graphics.BitmapAnimation;

	import flash.display.BitmapData;

	/**
	 * @author robertthurston
	 */
	public dynamic class ParticleData extends Object
	{
		public var x:Number = 0;
		public var y:Number = 0;
		public var px:Number = 0;
		public var py:Number = 0;
		public var direction:Number = 0;
		public var xSpeed:Number = 0;
		public var ySpeed:Number = 0;
		public var bitmapAnimation:BitmapAnimation;
		public var gravity:Number = 0;
		public var decay:Number = 1;
		public var life:Number;
		public var reSpawn:Boolean;
		public var ground:Number;
		public var elastisity:Number;
		public var startDelay:Number;
		public var alphaFade:Number;
		public var alphaBitmapDataArray:Array;

		public function ParticleData(alphaBitmapDataArray:Array)
		{
			this.alphaBitmapDataArray = alphaBitmapDataArray;
		}

		public function get nextFrame():BitmapData
		{
			return bitmapAnimation.getNextFrame();
		}

		public function get alphaBitmapData():BitmapData
		{
			return alphaBitmapDataArray[Math.floor(alphaFade * 10)];
		}
	}
}
